//提示框
export const setTip = ({commit}, tip) => {
  if (!tip.time) tip.time = 1800
  commit('SET_TIP', tip)
}
//弹框
export const setModal = ({commit}, modal) => {
  commit('SET_MODAL', modal)
}
//loading
export const setLoading = ({commit}, loading) => {
  commit('SET_LOADING', loading)
}
//新手指引
export const setGuide = ({commit}, guideParam) => {
  commit('SET_GUIDE', guideParam)
}
//创建组合-组合初始资金
export const setInitmoney = ({commit},initmoney) => {
  commit('SET_INITMONEY',initmoney)
}
//创建组合-组合名称
export const setGroupname = ({commit},groupname) => {
  commit('SET_GROUPNAME',groupname)
}
//创建组合-添加至组合中的股票
export const setAddStocks = ({commit},addStocks) => {
  commit('SET_ADDSTOCKS',addStocks)
}
//创建组合信息
export const setGroupMessages = ({commit},groupMessages) => {
  commit('SET_GROUPMESSAGES',groupMessages)
}
//创建组合-选择模拟买入原因
export const setMyReasons = ({commit},myReasons) => {
  commit('SET_MYREASONS',myReasons)
}
//组合创建者的昵称
export const setGroupNickname = ({commit},group_nickname) => {
  commit('SET_GROUPNICKNAME',group_nickname)
}


// 交易部分action
export const setBuyDelegatePrice = ({commit}, price) => {
  commit('SET_BUY_DELEGATE_PRICE', price)
}

export const setBuyStockCode = ({commit}, code) => {
  commit('SET_BUY_STOCK_CODE', code)
}

export const setBuyStockGroups = ({commit}, groups) => {
  commit('SET_BUY_STOCK_GROUPS', groups)
}

export const setBuyEnableVol = ({commit}, vol) => {
  commit('SET_BUY_ENABLE_VOL', vol)
}

export const setBuyAmount = ({commit}, amount) => {
  commit('SET_BUY_AMOUNT', amount)
}

export const setBuyFivePrices = ({commit}, prices) => {
  commit('SET_BUY_FIVE_PRICES', prices)
}

export const setSellDelegatePrice = ({commit}, price) => {
  commit('SET_SELL_DELEGATE_PRICE', price)
}

export const setSellStockCode = ({commit}, code) => {
  commit('SET_SELL_STOCK_CODE', code)
}

export const setSellStockGroups = ({commit}, groups) => {
  commit('SET_SELL_STOCK_GROUPS', groups)
}

export const setSellEnableVol = ({commit}, vol) => {
  commit('SET_SELL_ENABLE_VOL', vol)
}

export const setSellAmount = ({commit}, amount) => {
  commit('SET_SELL_AMOUNT', amount)
}

export const setSellFivePrices = ({commit}, prices) => {
  commit('SET_SELL_FIVE_PRICES', prices)
}

export const setBuyStockName = ({commit}, name) => {
  commit('SET_BUY_STOCK_NAME', name)
}

export const setSellStockName = ({commit}, name) => {
  commit('SET_SELL_STOCK_NAME', name)
}

export const setBuyStockMarket = ({commit}, market) => {
  commit('SET_BUY_STOCK_MARKET',  market)
}

export const setSellStockMarket = ({commit}, market) => {
  commit('SET_SELL_STOCK_MARKET', market)
}

export const setBuyReasons = ({commit}, reasons) => {
  commit('SET_BUY_REASONS', reasons)
}

export const setSellReasons = ({commit}, reasons) => {
  commit('SET_SELL_REASONS', reasons)
}

export const setBuyDelegateType = ({commit}, delegateType) => {
  commit('SET_BUY_DELEGATE_TYPE', delegateType)
}

export const setSellDelegateType = ({commit}, delegateType) => {
  commit('SET_SELL_DELEGATE_TYPE', delegateType)
}

export const setBuyGroupId = ({commit}, groupId) => {
  commit('SET_BUY_GROUP_ID', groupId)
}

export const setSellGroupId = ({commit}, groupId) => {
  commit('SET_SELL_GROUP_ID', groupId)
}

export const setSellSearchResultsVisible = ({commit}, visible) => {
  commit('SET_SELL_SEARCH_RESULTS_VISIBLE', visible)
}

export const setBuySearchResultsVisible = ({commit}, visible) => {
  commit('SET_BUY_SEARCH_RESULTS_VISIBLE', visible)
}

export const setEmojiVisible = ({commit}, visible) => {
  commit('SET_EMOJI_VISIBLE', visible)
}

// 清除所有输入
export const clearTrade = ({commit}) => {
  commit('CLEAR_TRADE')
}

// history test
export const addHistoryLength = ({commit}, len = 1) => {
  commit('ADD_HISTORY_LENGTH', len)
}

// history back
export const historyBack = ({commit}, len = 2) => {
  commit('HISTORY_BACK', len)
}
//页面高度
export const setHtmlHeight = ({commit}, height) => {
  commit('SET_HTML_HEIGHT', height)
}
//团队赛列表过滤条件集合
export const setTeamFilters = ({commit}, teamFilters) => {
  commit('SET_TEAM_FILTERS', teamFilters)
}

//个人PK列表过滤条件集合
export const setPersonalPKFilters = ({commit}, personalPKFilters) => {
  commit('SET_PERSONAL_PK_FILTERS', personalPKFilters)
}